package com.jz.community.moduleshopping.orderList.view.ui;

import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.jz.community.basecomm.base.BaseMvpActivity;
import com.jz.community.basecomm.mvp.BaseMvpPresenter;
import com.jz.community.basecomm.routerUtils.RouterIntentConstant;
import com.jz.community.moduleshopping.R;
import com.jz.community.moduleshopping.R2;
import com.jz.community.moduleshopping.orderList.adapter.CommonViewPagerAdapter;
import com.jz.community.moduleshopping.orderList.fragment.OrderListFragment;

import butterknife.BindView;

/**
 * Created by Tony.Fan on 2019/1/7 13:23
 */
@Route(path = RouterIntentConstant.MODULE_SHOPPING_ORDER_PAYMENT)
public class OrderPaymentActivity extends BaseMvpActivity {

    @BindView(R2.id.order_home_title)
    TextView orderHomeTitle;
    @BindView(R2.id.order_home_toolbar)
    Toolbar orderHomeToolbar;
    @BindView(R2.id.order_home_viewpager)
    ViewPager orderHomeViewpager;
    @BindView(R2.id.title_back_left)
    ImageView titleBackLeft;
    private OrderListFragment orderListFragment;


    @Override
    protected int getContentView() {
        return R.layout.module_shopping_fragment_order_home;
    }

    @Override
    protected void initView() {
        setImmersionBar(orderHomeToolbar);
        orderHomeTitle.setText("待付款");
    }


    @Override
    protected void addListener() {
        super.addListener();
        titleBackLeft.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected void initDatas() {
        super.initDatas();
        initViewPager();
    }

    private void initViewPager() {
        CommonViewPagerAdapter viewPagerAdapter = new CommonViewPagerAdapter(getSupportFragmentManager());
        orderListFragment = OrderListFragment.newInstance(1);
        viewPagerAdapter.addFragment(orderListFragment);
        orderHomeViewpager.setAdapter(viewPagerAdapter);
    }

    @Override
    protected BaseMvpPresenter createPresenter() {
        return null;
    }


    @Override
    public void onDestroy() {
        super.onDestroy();
    }

}
